<?php
/* Smarty version 3.1.29, created on 2016-06-23 15:07:34
  from "D:\hsu\wampserver\2.4\install\www\news\TP\main.html" */

if ($_smarty_tpl->smarty->ext->_validateCompiled->decodeProperties($_smarty_tpl, array (
  'has_nocache_code' => false,
  'version' => '3.1.29',
  'unifunc' => 'content_576b8ab61a18d8_11976793',
  'file_dependency' => 
  array (
    'f785aa4ebdf40ac2d9730ca9c953fdc16f909280' => 
    array (
      0 => 'D:\\hsu\\wampserver\\2.4\\install\\www\\news\\TP\\main.html',
      1 => 1466665651,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_576b8ab61a18d8_11976793 ($_smarty_tpl) {
if (!is_callable('smarty_modifier_truncate')) require_once 'D:\\hsu\\wampserver\\2.4\\install\\www\\news\\libs\\plugins\\modifier.truncate.php';
?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>新闻首页</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="description" content=>
		<meta name="keywords" content="">
		<link rel="shortcut icon" href="http://static.bootcss.com/www/assets/ico/favicon.png">
		<!-- 新 Bootstrap 核心 CSS 文件 -->
		<link rel="stylesheet" href="plugin/bootstrap/bootstrap.min.css">
		<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
		<?php echo '<script'; ?>
 src="plugin/jquery/jquery.min.js"><?php echo '</script'; ?>
>
		<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
		<?php echo '<script'; ?>
 src="plugin/bootstrap/bootstrap.min.js"><?php echo '</script'; ?>
>
	</head>
	<body>
		<h1 class="text-center">欢迎您 <?php echo $_smarty_tpl->tpl_vars['username']->value;?>
</h1>
		<hr />
		
		<div class="container">
			<button class="pull-right btn btn-success" onclick="location='add.php'">新闻发布</button>
		</div>


		<?php
$_from = $_smarty_tpl->tpl_vars['Datalist']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$__foreach_v_0_saved_item = isset($_smarty_tpl->tpl_vars['v']) ? $_smarty_tpl->tpl_vars['v'] : false;
$_smarty_tpl->tpl_vars['v'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['v']->_loop = false;
foreach ($_from as $_smarty_tpl->tpl_vars['v']->value) {
$_smarty_tpl->tpl_vars['v']->_loop = true;
$__foreach_v_0_saved_local_item = $_smarty_tpl->tpl_vars['v'];
?>
		<div class="container">
			<h1>
				<a href="detail.php?newsid=<?php echo $_smarty_tpl->tpl_vars['v']->value['newsid'];?>
"><?php echo $_smarty_tpl->tpl_vars['v']->value['title'];?>
</a>
				
					<?php if ($_smarty_tpl->tpl_vars['v']->value['username'] == $_smarty_tpl->tpl_vars['username']->value) {?>
				
					&nbsp;&nbsp;&nbsp;&nbsp;<a href="update.php?newsid=<?php echo $_smarty_tpl->tpl_vars['v']->value['newsid'];?>
"><small>修改</small></a>&nbsp;&nbsp;<a href="delete-check.php?newsid=<?php echo $_smarty_tpl->tpl_vars['v']->value['newsid'];?>
" onclick="return confirm('确认删除吗？');"><small>删除</small></a>
					<?php }?>
			</h1>
			<p>
				<?php echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['v']->value['content'],300,"...");?>

			</p>
			<div class="pull-right">发布人：<span class="label label-primary"><?php echo $_smarty_tpl->tpl_vars['v']->value['username'];?>
</span>
			&nbsp;&nbsp;发布时间：<span class="label label-primary"><?php echo $_smarty_tpl->tpl_vars['v']->value['publish_date'];?>
</span>
			 &nbsp;&nbsp;浏览次数：<span class="label label-primary"><?php echo $_smarty_tpl->tpl_vars['v']->value['views'];?>
</span></div>
		</div>
		<?php
$_smarty_tpl->tpl_vars['v'] = $__foreach_v_0_saved_local_item;
}
if ($__foreach_v_0_saved_item) {
$_smarty_tpl->tpl_vars['v'] = $__foreach_v_0_saved_item;
}
?>
	
	</body>
</html>
<?php }
}
